package Ep04_StackAndQueue.Offer_09;

import Ep05_StackAndQueue._0225.DoubleQueue;

import java.util.Stack;

/**
 * @author Jimmy Zhan WORKSTATION
 * @since 2023/7/17 11:29
 * 说明：
 */

public class Mine {
    Stack<Integer> inS;
    Stack<Integer> outS;
    public Mine() {
        inS = new Stack<>();
        outS = new Stack<>();
    }

    public void appendTail(int value) {
        inS.push(value);
    }

    public int deleteHead() {
        while (!inS.isEmpty()){ // in中还有元素就挨个pop进out
            outS.push(inS.pop());
        }
        if (outS.isEmpty()) return -1;
        return outS.pop();
    }
}
